//
//  HeaderCollectionViewCell.m
//  intelligent
//
//  Created by 甘世清 on 2024/2/8.
//

#import "HeaderCollectionViewCell.h"

@implementation HeaderCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.masksToBounds = YES;
        [self SQ_UIViewForSelfView];
    }
    return self;
}
/// 添加ui
-(void)SQ_UIViewForSelfView
{
    [self.contentView addSubview:self.bgImage];
    [self.contentView addSubview:self.yesImage];
    [self.bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(88);
        make.centerX.bottom.equalTo(self.contentView);
    }];
    [self.yesImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(24);
        make.top.equalTo(self.bgImage).offset(-12);
        make.right.equalTo(self.bgImage.mas_right).offset(12);
    }];
}
- (UIImageView *)bgImage{
    if (!_bgImage) {
        _bgImage = [[UIImageView alloc]init];
        _bgImage.contentMode = UIViewContentModeScaleAspectFit;
        _bgImage.layer.cornerRadius = 4;
    }
    return _bgImage;
}
- (UIImageView *)yesImage{
    if (!_yesImage) {
        _yesImage = [[UIImageView alloc]init];
        _yesImage.contentMode = UIViewContentModeScaleAspectFit;
        _yesImage.layer.cornerRadius = 4;
        _yesImage.image = SQGetImage(@"选中头像");
    }
    return _yesImage;
}

@end
